var t = getApp();

Page({
    data: {
        language: "",
        order_id: "",
        goodList: [],
        totalNum: 0,
        totalPrice: "",
        order_sn: "",
        orderData: null,
        balance: 0,
        payParams: "",
        info_form: {},
        money: "",
        buttons: [],
        pay_sn: "订单编号",
        order_pay_id: "",
        uid: "",
        shareTit: "",
        shareUrl: "",
        shareImg: "",
        shareContent: "",
        styleTwo: "",
        code_url: ""
    },
    getOrderDetail: function() {
        var a = this, e = t.getNetAddresss("order.another-pay-detail");
        e += "&order_id=" + a.data.order_id, t._getNetWork({
            url: e,
            success: function(t) {
                1 == t.data.result ? a.setData({
                    goodList: t.data.data
                }) : (wx.showToast({
                    title: t.data.msg,
                    icon: "success",
                    duration: 2e3
                }), console.log("错误", t.data.msg));
            },
            fail: function(t) {}
        });
    },
    getShareInfo: function() {
        var a = this, e = this, r = t.getNetAddresss("member.member.anotherShare");
        r += "&order_ids=" + e.data.order_id, t._getNetWork({
            url: r,
            success: function(t) {
                console.log("ressss::::", t), 1 == t.data.result ? (e.setData({
                    shareTit: t.data.data.title,
                    shareUrl: t.data.data.url,
                    shareImg: t.data.data.img,
                    shareContent: t.data.data.content
                }), t.data.data.code_url && a.setData({
                    code_url: t.data.data.code_url
                })) : (wx.showToast({
                    title: t.data.msg,
                    icon: "success",
                    duration: 2e3
                }), console.log("错误", t.data.msg));
            },
            fail: function(t) {}
        });
    },
    onShareTimeline: function() {
        var t = wx.getStorageSync("yz_uid"), a = "";
        return t && (a = t), {
            title: this.data.shareTit,
            desc: this.data.shareContent,
            imageUrl: this.data.shareImg,
            query: "id=" + this.data.order_id + "&p=" + a
        };
    },
    onShareAppMessage: function() {
        var t = wx.getStorageSync("yz_uid"), a = "";
        t && (a = t);
        var e = 1;
        return this.data.styleTwo && (e = 2), {
            title: this.data.shareTit,
            desc: this.data.shareContent,
            imageUrl: this.data.shareImg,
            path: "/packageD/buy/payanotherDetail/payanotherDetail?id=" + this.data.order_id + "&p=" + a + "&share_type=" + e
        };
    },
    getPrice: function() {
        var a = this, e = wx.getStorageSync("yz_uid"), r = "";
        e && (r = e);
        var s = t.getNetAddresss("order.merge-pay.anotherPayOrder");
        s += "&order_ids=" + this.data.order_id, s += "&pid=" + r, t._getNetWork({
            url: s,
            success: function(t) {
                if (1 == t.data.result) {
                    var e = t.data.data.order_pay.amount;
                    a.setData({
                        totalPrice: e
                    });
                } else wx.showToast({
                    title: t.data.msg,
                    icon: "success",
                    duration: 2e3
                }), console.log("错误", t.data.msg);
            },
            fail: function(t) {}
        });
    },
    onLoad: function(t) {
        console.log("options:", t), this.setData({
            order_id: t.order_id
        }), t.style && this.setData({
            styleTwo: !0
        }), this.getOrderDetail(), this.getPrice(), this.getShareInfo();
    },
    onReady: function() {
        var t = wx.getStorageSync("langIndex");
        this.setData({
            language: t.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {}
});